package com.example.lt.mapper.video;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lt.entity.video.Video;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author 小涛Tao
 * @Date: 2024/07/29/21:22
 * version 1.0 注释：
 **/
@Repository
public interface VideoMapper extends BaseMapper<Video> {

    @Select("SELECT id,share_count,history_count,start_count,favorites_count,gmt_created,title FROM video WHERE id >" +
            "#{id} and open = 0 and audit_status = 0 and DATEDIFF(gmt_created,NOW())<=0 AND DATEDIFF(gmt_created,NOW())>- #{days} limit #{limit}")
    List<Video> listNDaysAgeVideo(long id, int days, int limit);
}
